import { createSlice, PayloadAction } from '@reduxjs/toolkit';

const initialState = {
  code: '',
  platform: 'ios',
};

const config = createSlice({
  name: 'config',
  initialState,
  reducers: {
    setState(state, action: PayloadAction<Partial<configState>>) {
      Object.assign(state, action.payload);
    },
  },
  extraReducers: () => {},
});

export type configState = typeof initialState;
export const configReducer = config.reducer;
export const configActions = config.actions;
export default config;
